using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Net5Wpf
{
    /// <summary>
    /// CloseButton.xaml 的交互逻辑
    /// </summary>
    public partial class CloseButton : UserControl
    {
        Pen pen;
        public CloseButton()
        {
            InitializeComponent();
            pen = new Pen(Brushes.Black, 2);
        }

        protected override void OnRender(DrawingContext drawingContext)
        {
            drawingContext.DrawEllipse(Brushes.Transparent, pen, new Point(this.Width / 2, this.Height / 2), this.Width / 2, this.Height / 2);
            drawingContext.DrawLine(pen, new Point(this.Width/4, this.Height/4), new Point(this.Width/4*3, this.Height/4*3));
            drawingContext.DrawLine(pen, new Point(this.Width/4, this.Height/4*3), new Point(this.Width/4*3, this.Height/4));
        }
    }
}
